package org.example.service.Impl;

import org.example.common.ResponseMessage;
import org.example.entity.dto.WorkSheetDto;
import org.example.mapper.WorkSheetMapper;
import org.example.service.WorkSheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WorkSheetServiceImpl implements WorkSheetService {
    @Autowired
    private WorkSheetMapper workSheetMapper;

    /**
     * 新增周表
     * @return
     */
    @Override
    public ResponseMessage addSheet(WorkSheetDto workSheetDto){
        int count = workSheetMapper.insert(workSheetDto);
        if (count > 0){
            return ResponseMessage.success(workSheetDto);
        }
        return ResponseMessage.error();
    }

    @Override
    public ResponseMessage delByID(Integer ID){
        int count = workSheetMapper.delSheet(ID);
        if (count > 0){
            return ResponseMessage.success(null);
        }
        return ResponseMessage.error();
    }

//    /**
//     * 新增周计划
//     * @param workPlanDto
//     * @return
//     */
//    @Override
//    public ResponseMessage addPlan(WorkPlanDto workPlanDto){
//        int count = workPlanMapper.insert(workPlanDto);
//        if (count > 0){
//            return ResponseMessage.success("添加成功",workPlanDto);
//        }
//        return ResponseMessage.error();
//    }
//    @Override
//    public ResponseMessage delByID(Integer ID){
//        int count = workPlanMapper.delWork(ID);
//        if (count > 0){
//            return ResponseMessage.success("删除成功",null);
//        }
//        return ResponseMessage.error();
//    }
//
//    @Override
//    public ResponseMessage update(WorkPlanDto workPlanDto){
//        int count = workPlanMapper.updateWork(workPlanDto.getEmpId());
//        if (count > 0){
//            return ResponseMessage.success("更新成功",workPlanDto);
//        }
//        return ResponseMessage.error();
//    }
}
